﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace csharp_memory
{
    class Program
    {
        static void Main(string[] args)
        {
            ulong total_memory = new Microsoft.VisualBasic.Devices.ComputerInfo().TotalPhysicalMemory;
            Console.WriteLine("total: {0}", total_memory);

            Process proc = Process.GetCurrentProcess();
            Console.WriteLine("private memory: {0}", proc.PrivateMemorySize64);
            Console.WriteLine("peak virtual memory: {0}", proc.PeakVirtualMemorySize64);
            Console.WriteLine("paged system memory: {0}", proc.PagedSystemMemorySize64);
            Console.WriteLine("paged memory: {0}", proc.PagedMemorySize64);
            Console.WriteLine("nonpaged system memory: {0}", proc.NonpagedSystemMemorySize64);
            Console.WriteLine("peak paged memory: {0}", proc.PeakPagedMemorySize64);
            Console.WriteLine("peak working set: {0}", proc.PeakWorkingSet64);
            Console.WriteLine("virtual memory: {0}", proc.VirtualMemorySize64);
            Console.WriteLine("working set: {0}", proc.WorkingSet64);

            Console.Write("press anykey...");
            Console.ReadKey();
        }
    }
}
